/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gs.coursera.algorithms.core.graph.ui;

import java.awt.Dimension;

import com.gs.coursera.algorithms.core.graph.Graph;

/**
 *
 * @author Sabuj
 */
public class GraphDisplayPanel extends javax.swing.JPanel {

    /**
     * Creates new form GraphDisplayPanel
     */
    public GraphDisplayPanel() {
        initComponents();
        //setMinimumSize(new Dimension(12345, 12345));
        //setPreferredSize(new Dimension(12345, 12345));
    }
    
    public <T, W extends Comparable<W>> void display(Graph<T, W> graph){
        AdjacencyListPanel<T, W> alp = new AdjacencyListPanel<T, W>(graph);
        add(alp, java.awt.BorderLayout.CENTER);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        setLayout(new java.awt.BorderLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 15)); // NOI18N
        jLabel1.setText("Graph");
        add(jLabel1, java.awt.BorderLayout.PAGE_START);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
